Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail integration tests appropriately #545

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Apr 12, 2022

Closes #540

This is a:

  • bug fix PR with no breaking changes

Description & motivation

The integration tests passed in CircleCI even though one of the dbt steps failed. This is because the shell script only returns the final exit code -- intermediate exit codes are ignored by default.

Several options to solve this issue are discussed here.

Chosen option: command || exit 1 because it is minimally invasive, low risk, and preserves our optionality in the future.

Positive Consequences

  • solves the immediate problem
  • low risk
  • minimally invasive and straight-forward
    • only requires adding the || exit 1 suffix to 5 lines of code
  • preserves our optionality in the future
    • completely reversible
    • doesn't prevent us from pursuing the other ideas like dbt build, etc as the next logical steps to take
  • inspiration to learn more how bash behaves

Negative Consequences

  • raises question if this solution should be advocated for every other project that uses something like a run_test.sh script
  • harder to read for those of us not expert in bash

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
  • I followed guidelines to ensure that my changes will work on "non-core" adapters by:
    • dispatching any new macro(s) so non-core adapters can also use them (e.g. the star() source)
    • using the limit_zero() macro in place of the literal string: limit 0
    • using dbt_utils.type_* macros instead of explicit datatypes (e.g. dbt_utils.type_timestamp() instead of TIMESTAMP
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)
  • I have added an entry to CHANGELOG.md

@dbeatty10 dbeatty10 requested a review from jasnonaz April 25, 2022 22:37
Copy link
Contributor

@jasnonaz jasnonaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks for fixing this!

@dbeatty10 dbeatty10 merged commit 4116441 into next/patch Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants